Skip to content

Disconnect only if the ESP has connected before #2708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

CloudyPadmal
Copy link

I've tried the scanning function in ESP many times with many ESPs and every time they stop functioning and crashed. So I checked line by line and found out that this disconnect() upon no connection is the one causing it. So I added the control block to see if there is any connection and now they're working fine!

I've tried scanning function in ESP many times with many ESPs and every time they stop functioning and crashed. So I checked line by line and found out that this disconnect upon no connection is the one causing it. So I added the control block and now they're working fine!
@codecov-io
Copy link

Current coverage is 27.80% (diff: 100%)

Merging #2708 into master will not change coverage

@@             master      #2708   diff @@
==========================================
  Files            20         20          
  Lines          3625       3625          
  Methods         335        335          
  Messages          0          0          
  Branches        656        656          
==========================================
  Hits           1008       1008          
  Misses         2441       2441          
  Partials        176        176          

Powered by Codecov. Last update 7b32e6a...cf3ff56

@devyte devyte added this to the 2.6.0 milestone Oct 31, 2019
@devyte devyte self-assigned this Oct 31, 2019
@earlephilhower
Copy link
Collaborator

@devyte, does this still make sense? Looks to me to be a race condition (there's some small chance WiFi IRQ will get connection between if (!connected()) and the disconnect.

Also, I thought this kind of thing was fixed w/the IRQ stack fixes recently implemented.

@devyte
Copy link
Collaborator

devyte commented Oct 31, 2019

Maybe you're right, but then calling disconnect when there is no prior connection should be tested. if thst doesn't crash, just close this.

@devyte
Copy link
Collaborator

devyte commented Nov 6, 2019

I just tested, and calling WiFi.disconnect() without a prior connection doesn't crash with latest git.
That means this PR is not needed.
Closing.

@devyte devyte closed this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants